package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-12 16:07
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class Demo03 {

  public static void main(String[] args) {
    System.out.println("".length());//方法
    System.out.println(new int[]{1,2,3}.length);//属性

    String a = "abcdABCDabcd";
    System.out.println(a.indexOf('c'));
    System.out.println(a.indexOf("cd"));
    System.out.println(a.indexOf("ca"));
    System.out.println(a.indexOf("cd",2));
    System.out.println(a.indexOf("cd",3));
    System.out.println(a.lastIndexOf("cd"));
    System.out.println(a.lastIndexOf("cd",10));
    System.out.println(a.lastIndexOf("cd",9));

  }
}
